<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="div1">
<p id="p1">我是第一个节点</p>
    <p id="p2">我是第二个节点</p>
    <p id="p3">我是第三个节点</p>
</div>

<script>
    let div1 = document.getElementById('div1');


    let li1 = document.createElement('p');
    //在一个节点里面写入值 就像手写<li>我是后面添加的li元素</li>
    li1.innerHTML = '<a href="#">我是后面添加的li元素</a>';

    let p1 = document.getElementById('p1');
    //删除节点
    div1.removeChild(p1)
</script>
</body>
</html>